# 使用内网镜像仓库的nginx镜像
FROM 172.73.0.156:85/public/nginx:latest

# 删除默认的nginx配置
RUN rm /etc/nginx/conf.d/default.conf

# 复制自定义nginx配置
COPY nginx.conf /etc/nginx/conf.d/default.conf

# 复制已构建好的前端文件
COPY dist /usr/share/nginx/html

# 暴露端口
EXPOSE 80

# 健康检查 - 使用nginx内置方式
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
    CMD test -f /usr/share/nginx/html/index.html || exit 1

# 启动nginx
CMD ["nginx", "-g", "daemon off;"]
